package com.xp.tinyurl.common.enums;

import org.springframework.util.ObjectUtils;

/**
 * 产品线
 */
public enum BusinessLineEnum {

    XP("0","XP")

    ;

    private String code;

    private String desc;

    BusinessLineEnum(String code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static BusinessLineEnum getByCode(String code){
        if(ObjectUtils.isEmpty(code)){
            return null;
        }
        for(BusinessLineEnum businessLineEnum : BusinessLineEnum.values()){
            if(!businessLineEnum.getCode().equals(code)){
                continue;
            }
            return businessLineEnum;
        }
        return null;
    }
}
